package at.fhj.itm11.antesk.memory.model;

/**
 * Represents the player and logs score.
 * 
 * @author Ivan Antes-Klobucar
 * @version 1.1
 *
 */
public class Player {

	private int score;
	
	public Player(){
		score = 0;
	}

	public int getScore() {
		return score;
	}

	public void setScore(int score) {
		this.score = score;
	}
	
	/**
	 * Updates the playerscore positive or negative.
	 * Should the score fall below 0, it will be set to 0.
	 * 
	 * @param score addition to current score
	 */
	public void updateScore(int score){
		if((this.score + score) <= 0)
			this.score = 0;
		else
			this.score += score;
	}
}
